const version = 'tauri-app-try'
class Storage {
  setStorage(key, value) {
    sessionStorage.setItem(`${key}-${version}`, JSON.stringify(value))
    // console.log(JSON.stringify(value), this.getStorage(key));
  }

  getStorage(key) {
    const data = sessionStorage.getItem(`${key}-${version}`)
    // console.log("data", typeof data);
    return data === 'undefined' ? null : JSON.parse(data)
  }

  removeStorage(key) {
    sessionStorage.removeItem(`${key}-${version}`)
  }
}
const storage = new Storage()
export default storage
